Program Structures
What is a Computer Program..? Step by step instructions that direct the Computer to do the tasks you want it to do and produce the ...
What is a Computer Program..?
- Step by step instructions that direct the Computer to do the tasks you want it to do and produce the results you want.
- Software provides the instructions to the computer to fulfill certain task.
- These instructions are included the software and these instructions are written by using a programming language.
Steps to Develop a Program.
- Developing a program involves steps similar to any problem solving task.
- There are five main ingredients in the programming process.
- Defining the problem.
- Planning the solution.
- Coding the problem.
- Testing the program.
- Documenting the program.
Planing the solutions.
Two common ways of planning the solution to a problem.
- Draw flowcharts
- write pseudo code
- Or possibly both
Testing the Program.
- After coding the program, You must test it on the computer.
- Testing methods
- Desk checking
- Translating
- Debugging
Why structure...?
- Structuring a program helps to break it down in to understandable chunks.
- The first stage in this process is to adopt the correct approach for developing the program from the information available
- The best known of these is the top down approach.
- Using this, look at the program as a whole : then sub divide it in to simpler components at lowest levels and repeat until no further break down is possible.
- The result is a hierarchically distinct, manageable, whose relationships and levels are clear and simple to see.
The Structure theorem..
- The structure theorem forms the basic framework for structure programming.
- It states that is possible to write any computer program by using only three control structures that are easily represented in pseudo code.
- Sequence
- Selection
- Repetition
Sequence
The sequence control structure is the straight forward execution of one processing step after another.
Selection
The selection control structure is the presentation of and the choice between two actions the choice depending on whether the condition is true or false.
Repetition
The repetition control structure can be defined as the presentation of a set of instructions to be performed repeatedly as long as a condition is true.

